<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by bothin
  At 2019/12/17 20:42
  Description:
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.bothin.experiment4.enums.ProductFormStatusEnum" %>
<table class="layui-table" style="width: 700px;margin: 25px;">
    <colgroup>
        <col>
        <col>
        <col>
        <col>
        <col>
        <col width="90">
    </colgroup>
    <thead>
    <tr>
        <th>合同编号</th>
        <th>客户姓名</th>
        <th>销售员</th>
        <th>总价格</th>
        <th>签定时间</th>
        <%--        <th>履行状态</th>--%>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>${contactDTO.contactId}</td>
        <td>${contactDTO.customerName}</td>
        <td>${contactDTO.employeeName}</td>
        <td>${contactDTO.money}</td>
        <td>${contactDTO.createTime}</td>
        <%--            <td><a class="layui-btn layui-btn-normal layui-btn-xs">${contactDTO.performanceStatusEnum.message}</a></td>--%>
    </tr>
    <tr>
        <td colspan="5">
            <c:forEach items="${contactDTO.contactDetailDTOList}" var="item" varStatus="status">
                <div>
                    <span style="margin-right: 20px;">${status.count}</span>
                    <img src="${item.product.productIcon}" alt="商品图片" style="width: 70px;height: 70px;">
                    <span style="margin-left: 20px;">商品名称：${item.product.productName}</span>
                    <span style="margin-left: 20px;">商品价格：${item.product.productPrice}</span>
                    <span style="margin-left: 20px;">数量：${item.productQuantity}</span>
                    <span style="margin-left: 20px;">进度：
                                ${item.productQuantity-item.printStatus==0?"尚未发货":''}
                                <c:if test="${item.productQuantity-item.printStatus>0&&item.productQuantity-item.printStatus<item.productQuantity}">
                                    剩余${item.printStatus} 件未发货
                                </c:if>
                                ${item.printStatus==0?"已完成生成发货单":''}
                        </span>
                </div>
            </c:forEach>
        </td>
    </tr>
    <c:if test="${contactDTO.productFormDTOList.size()>0}">
        <tr>
            <td colspan="5">
                <c:forEach items="${contactDTO.productFormDTOList}" var="item" varStatus="status">
                    <div style="margin-bottom: 20px;">
                        <span>${status.count}</span>
                        <span style="margin-left: 20px;">发货编号：${item.formId}</span>
                        <span style="margin-left: 20px;">商品名称：${item.productName}</span>
                        <span style="margin-left: 20px;">数量：${item.productQuantity}</span>
                        <span style="margin-left: 20px;">进度：
                                <c:if test="${item.productFormStatusEnum.equals(ProductFormStatusEnum.UNFINISHED)}">
                                    <button class="layui-btn layui-btn-primary layui-btn-xs">${ProductFormStatusEnum.UNFINISHED.message}</button>
                                </c:if>
                                    <c:if test="${item.productFormStatusEnum.equals(ProductFormStatusEnum.TRANSIT)}">
                                        <button data-eid="${item.formId}" class="layui-btn layui-btn-warm layui-btn-xs change_logist">${ProductFormStatusEnum.TRANSIT.message}</button>
                                    </c:if>
                                    <c:if test="${item.productFormStatusEnum.equals(ProductFormStatusEnum.FINISH)}">
                                        <button class="layui-btn layui-btn-normal layui-btn-xs">${ProductFormStatusEnum.FINISH.message}</button>
                                    </c:if>
                        </span>
                    </div>
                </c:forEach>
            </td>
        </tr>
    </c:if>
    </tbody>
</table>
<script>
    //JavaScript代码区域
    layui.use(['element','jquery','layer'], function(){
        var element = layui.element,$=layui.jquery,layer=layui.layer;

    });

</script>
